<?php
namespace app\home\model;

use think\Model;
use think\Db;

class Login extends Model
{
	protected $table = 'user_home';

	/**
	 * 验证登录
	 * @param  [type]
	 * @return [null | data] 用户信息
	 */
	public function login($data)
	{
		//查询数据库是否有这个信息
		return Db::table($this->table)->where(
			[
				'phone' => $data['phone'],
				'password' => md5($data['password'])
			]
		)->find();
	}
}